package cache

import (
	"sync"
	"time"

	"github.com/go-redis/redis"
)

var redisClient *redis.Client
var once sync.Once

func EnableCache() *redis.Client {
	once.Do(func() {
		redisClient = redis.NewClient(&redis.Options{
			// Addr: r.Addr(),
		})
	})

	return redisClient
}

func Client() *redis.Client {
	return nil
}

func Put[T any] (key string, data T, time.Duration... expireTime) error {
	redisClient.Set(key, data, expireTime)
}

func PutIfAbsent() (bool, error) {

}

func Get[T any](key string) T, error {

}

func GetAsString(key string) string,error {

}

func Del(key string)error {

}

func Refresh(key string, time.Duration... expireTime)error {

}
